Skip to main content

Data Types

Fig supports various data types for representing different kinds of values. Here are some commonly used data types: Integer (i32, i64, etc.)

Integers are used to represent whole numbers. They can be signed or unsigned and of various sizes.

let num: i32 = 42;

Floating Point (f32, f64)

Floating-point numbers are used to represent numbers with fractional parts.

let pi: f64 = 3.14159;

Character (char)

Characters represent single Unicode characters.

let letter: char = 'A';

Array (T[])

Arrays are ordered collections of elements of the same type.

let array: i32[] = [1, 2, 3, 4, 5];